package sg.edu.nus.iss.billing.model.transaction;


import java.text.DecimalFormat;

import sg.edu.nus.iss.billing.model.BaseModel;

/**
 * @author Yeo Hee Ling
 *
 */
public class PaymentTransaction extends BaseModel {
	private static final long serialVersionUID = 1L;
	
	private String accountNo;
	private double paymentAmt = 0;
	private String paymentDate;
	
	public String getAccountNo() {
		return accountNo;
	}
	public void setAccountNo(String accountNo) {
		this.accountNo = accountNo;
	}
	public double getPaymentAmt() {
		return roundTwoDecimals(paymentAmt);
	}
	public void setPaymentAmt(double paymentAmt) {
		this.paymentAmt = paymentAmt;
	}
	public String getPaymentDate() {
		return paymentDate;
	}
	public void setPaymentDate(String paymentDate) {
		this.paymentDate = paymentDate;
	}
	
	private double roundTwoDecimals(double d) {
		DecimalFormat twoDForm = new DecimalFormat("#.##");
		return Double.valueOf(twoDForm.format(d));
	}
}
